package cn.house.util;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {
	
	private static Configuration cf;
	
	private static SessionFactory fc;
	
	static {
		
		cf = new Configuration().configure();
		fc = cf.buildSessionFactory();
	}
	
	/**
	 * 创建返回sesson
	 * @return
	 */
	public static Session getSession() {
		
		return fc.getCurrentSession();
	}

}
